<?php

class Reale_Model_Enquiry 
{
	/**
	 * 
	 * Stores enquiry identification number
	 * @var int
	 */
	protected $_enquiry_id;
	
	/**
	 * 
	 * Stores agent identification number
	 * @var int
	 */
	protected $_agent_id;
	
	/**
	 * 
	 * Stores enquiry's subject
	 * @var string
	 */
	protected $_subject;
	
	/**
	 * 
	 * Stores enquiry's body text
	 * @var string
	 */
	protected $_body;
	
	/**
	 * 
	 * Stores enquiry's read status
	 * @var boolean
	 * 
	 * 0 => unread  
	 * 1=> read
	 */
	protected $_is_read;
	
	/**
	 * 
	 * Stores enquiry's acknowledgment status
	 * @var boolean
	 * 
	 * 0=> unacknowledged 
	 * 1=>acknowledged
	 */
	protected $_is_acknowledged;
	
	/**
	 * 
	 * Stores enquiry entity mapper
	 * @var Reale_Model_EnquiryMapper
	 * 
	 */
	protected $_mapper;
	
	/**
	 * 
	 * Setter function for data member enquiry_id 
	 * @param int enquiry_id
	 */
	public function setEnquiry_id($enquiry_id) {
		$this->_enquiry_id = $enquiry_id;
		return $this;
	}
	
	/**
	 * 
	 * Getter function for data member enquiry_id
	 * @return int $_enquiry_id
	 */
	public function getEnquiry_id() {
		if(isset($this->_enquiry_id)){
			return $this->_enquiry_id;	
		}
		throw new Exception('The objects primary key(i.e. $_enquiry_id) is not set.',Zend_Log::ERR); 
	}
	
	/**
	 * 
	 * Setter function for data member agent_id 
	 * @param int agent_id
	 */
	public function setaAgent_id($agent_id) {
		$this->_agent_id = $agent_id;
		return $this;
	}
	
	/**
	 * 
	 * Getter function for data member agent_id
	 * @return int $_agent_id
	 */
	public function getAgent_id() {
		return $this->_agent_id; 
	}
	
	
	/**
	 * 
	 * Setter function for data member subject 
	 * @param string subject
	 */
	public function setSubject($subject) {
		$this->_subject = $subject;
		return $this;
	}
	
	/**
	 * 
	 * Getter function for data member subject
	 * @return string $_subject
	 */
	public function getSubject() {
		return $this->_subject;	 
	}
	
	/**
	 * 
	 * Setter function for data member body 
	 * @param string body
	 */
	public function setBody($body) {
		$this->_body = $body;
		return $this;
	}
	
	/**
	 * 
	 * Getter function for data member body
	 * @return string $_body
	 */
	public function getBody() {
		return $this->_body;	
	}

	/**
	 * 
	 * Setter function for data member is_read 
	 * @param boolean is_read
	 */
	public function setIs_read($is_read) {
		$this->_is_read = $is_read;
		return $this;
	}
	
	/**
	 * 
	 * Getter function for data member is_read
	 * @return boolean $_is_read
	 */
	public function getIs_read() {
		return $this->_is_read;	
	}
	
	/**
	 * 
	 * Setter function for data member is_acknowledged 
	 * @param boolean is_acknowledged
	 */
	public function setIs_acknowledged($is_acknowledged) {
		$this->_is_acknowledged = $is_acknowledged;
		return $this;
	}
	
	/**
	 * 
	 * Getter function for data member is_acknowledged
	 * @return boolean $_is_acknowledged
	 */
	public function getIs_acknowledged() {
		return $this->_is_acknowledged;	
	}

	/**
	 * 
	 * Setter function for enquiry mapper 
	 * @param Reale_Model_EnquiryMapper
	 */
	public function setMapper($mapper) {
		$this->_mapper = $mapper;
		return $this;
	}
	
	/**
	 * 
	 * Getter function for enquiry mapper
	 * @return Reale_Model_EnquiryMapper $_mapper
	 */
	public function getMapper(){
        if (null === $this->_mapper) {
            $this->setMapper(new Reale_Model_EnquiryMapper());
        }
        return $this->_mapper;
    }
	
	/**
     * 
     * To put new enquiry
     * return Reale_Model_Enquiry | null
     * 
     */
    public function newEnquiry() {
    	$return = $this->getMapper()->newEnquiry($this);
    	
    	if ($return instanceof Reale_Model_EnquiryMapper) {
    		return this;
    	}
    	else {
    		return null;
    	}
    } 
	
}

